<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>动态创建节点</title>
	</head>
	<body>
		<!-- <li data-code="SA05" id="tab_SA05_销售发票" title="销售发票" data-index="1" class="active">
			<a href="#SA05_销售发票" role="tab" data-toggle="tab" aria-expanded="true">
				<span>销售发票</span>
				<i class="fa ticon ticon-close"></i>
			</a>
		</li> -->
		<div class="tab-pane active" id="SA05_销售发票">
			<div class="container-fluid" style="height: 550px;">
				<iframe id="SA05_iframe" frameborder="0" width="100%" height="100%" style="padding:0px 0px 0px 0px;"
					src="/tplus/BAPView/Voucher.aspx?mId=SA05&amp;pId=voucherView&amp;sysId=SA&amp;SourceType=FromMenu&amp;taskID=%E9%94%80%E5%94%AE%E5%8F%91%E7%A5%A8&amp;TaskSessionID=06b2f743-6bf5-a59f-4e81-7e324918eb53">
				</iframe>
			</div>
		</div>
		<ul id="menus"></ul>
	</body>
</html>

<script type="text/javascript">
	function createLi() {
		//li标签
		let li = document.createElement("li");
		li.setAttribute("data-code", "SA05");
		li.setAttribute("id", "tab_SA05_销售发票");
		li.setAttribute("title", "销售发票");
		li.setAttribute("data-index", 1);
		li.setAttribute("class", "active");

		//a标签
		let a = document.createElement("a");
		a.setAttribute("href", "#SA05_销售发票");
		a.setAttribute("role", "tab");
		a.setAttribute("data-toggle", "tab");
		a.setAttribute("aria-expanded", true)

		//span
		let span = document.createElement("span");
		span.innerText = "销售发票"

		//组合
		a.appendChild(span)
		li.appendChild(a);

		document.getElementById("tabs").appendChild(li)
	}

	/**
	 * class="tab-pane active" id="SA05_销售发票"
	 */
	function createPanel() {
		let panel = document.createElement("div");
		panel.classList.add("tab-pane")
		panel.classList.add("active")
		panel.setAttribute("id", "SA05_销售发票");
		
		let container = document.createElement("div");
		container.setAttribute("id", "SA05_销售发票");
		container.style.height = "550px";
		/* iframe */
		let iframe = document.createElement("iframe");
		iframe.setAttribute("id","SA05_iframe");
		iframe.setAttribute("frameborder","0");
		iframe.setAttribute("width","100%");
		iframe.setAttribute("height","100%");
		iframe.style.padding="0px 0px 0px 0px";
		iframe.setAttribute("src","http://www.sina.com.cn")
		
		//组合
		container.appendChild(iframe);
		panel.appendChild(container);
		
		//嵌套
		document.getElementById("portal-tab").appendChild(panel);
	}
	
	function clearClass(className,removeClassName){
		/* tab-pane */
		let arr = document.getElementsByClassName(className);
		for (var i = 0; i < arr.length; i++) {
			arr[i].classList.remove(removeClassName)
		}
	}
	createLi();
	createPanel();
</script>
